<template>
	<div class="login-container">
		<el-form class="card-box login-form" :model="loginForm" :rules="loginRules">
			<h3>系统登录</h3>
			<el-form-item label="用户名" prop="loginname">
				<el-input type="text" name="loginname" v-model="loginForm.username" auto-complete="off" ></el-input>
			</el-form-item>
			<el-form-item label="密码" prop="password">
				<el-input type="password" v-model="loginForm.password" ></el-input>
			</el-form-item>
			<el-button type="primary" @click.native.prevent="loginSubmit">登录</el-button>
		</el-form>
	</div>
</template>

<script>
import {login} from '@/api/login'
export default {
	name: 'login',
	data () {
		return {
	      	loginForm: {
	        	username: 'admin',
	        	password: '123456'
	      	},
	      	loginRules: {
	        	username: [{ required: true, trigger: 'blur' }],
	        	password: [{ required: true, trigger: 'blur' }]
	      	},
	      	pwdType: 'password',
	      	loading: false,
	      	showDialog: false
	    }
	},
	methods: {
		loginSubmit: function () {
			login('admin', '123456')
			this.$router.push({ path: '/' })
		}
	}
}
</script>

<style type="text/css">
	
</style>